﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EC_ASS.Models;


namespace EC_ASS.Controllers
{
    public class CategoryController : Controller
    {
        //
        // GET: /Category/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult ViewAll(string id, string name)
        {
            DataECDataContext context = new DataECDataContext();
            var products = context.Products.Where(product => product.CatID == Int32.Parse(id));
            ViewBag.Name = name;
            return View(products.ToList());
        }

    }
}
